Why Axie Infinity?
Are you into NFT’s? How about Play-to-earn (P2E) games?
This is one of the first Twitter scraping and data analysis done for a trending play to earn scheme called Axie Infinity?
Why Axie Infinity? If you like games and you can spend hours and hours gaming and playing games, then why not play and earn money at the same time? Are you familiar with grinding in game, where you spend hours and hours levelling up? In Axie, you can do so while earning money as well.
How do you get started?
There are multiple ways you can play and earn via the game, one is if you buy your own “Axies” which are the in game assets. This means you will be funding your own capital. In order to play, you will be needing 3 axies which can cost from “$1,000-$1,500” for a set of 3, depending on the skills, classes and combinations. Another way for you to earn is for you to buy some Axies and breed them yourself to make baby Axies, which you can then sell in the marketplace.
If you have no capital, you can apply to a “scholarship” and be a “scholar”, the capital owner will be your “manager”. As a scholar, you’ll trade of your time and skills to play the game, while the manager will be providing you with the capital to play. Then the “scholar” and the “manager”, will split the earnings depending on their agreement. With this quick analaysis, I will be looking at some sentiments for certain tags related to the game Axie Infinity.
Key words to be scraped
- Axie
- axie infinity
- AXS
- SLP
- SkyMavis
- Scholarship
- Manager
- Scholar
Scope & Limitation
Due to the limited number of tweets allowed to be scraped by my developer account, I will be limiting the scraping to 10,000 tweets per “Tag”. For further continuation of the analysis, and further expansion of the trends with Axie Infinity, more tweets can definitely beanalyzed.
Challenges
Here are some key things to note when you want to scrape from Twitter. One, applying for the twitter developer API takes time, and takes longer during the holidays. There are also different account tiers that can help you scrape more information with lesser restrictions. I still have my application for the education tier for million tweet scrapes pending. Aside from this, getting the Twitter API to work is challenging and can be very tricky, you need to set the correct settings to get it to work. :)
Libraries
- library(“prettydoc”)
- library(“base64enc”)
- library(“openssl”)
- library(“httpuv”)
- library(“twitteR”)
- library(“tm”)
- library(“stringr”)
- library(“dplyr”)
- library(“httr”)
- library(“tidyverse”)
- library(“tidytext”)
- library(‘plotly’)
Setting up the Twitter API
Twitter API keys
consumerKey = "W7d5usbfcYt3wZPS348sXwJ3i"
consumerSecret = "GmJ2krkd0Iih1WYXm2Ml2fapcVlwNqgUEBtVQit25ddKrPjDqo"
accessToken = "850647463-lnYE2WUANf2pW0BGTLHbAdkD3g104x03v33cW1zv"
accessSecret = "ssPRkGCIXhVYylKGZWxiJq1ffRk1WYuiinImMsmBW03rO"API configuration
setup_twitter_oauth(consumerKey, consumerSecret,
accessToken,accessSecret)## [1] "Using direct authentication"
Note: Section below is commented because there are limited API calls allowed. So, all the words were scrapped and saved into a csv file for later processing.
Scraping tweets with “Axie”
This is the quick shortcut / slang of what people call the game
Separate all the tweets into a list of words, gives 282,490 list of words
# tt = searchTwitter('Axie', n = 10000, since = '2021-01-01')
# Axie <- twListToDF(tt)
# write.csv(Axie,"Axie10000.csv", row.names = FALSE)Scraping tweets with “axie infinity”
This is the name of the game
Separate all the tweets into a list of words, gives 304,518 list of words
# tt = searchTwitter('axie infinity', n = 10000, since = '2021-01-01')
# axieinfinity <- twListToDF(tt)
# write.csv(axieinfinity,"axieinfinity10000.csv", row.names = FALSE)Scraping tweets with “SLP”
#SLP stands for smooth love potion, which is the in-game currency
Separate all the tweets into a list of words, gives 352,123 list of words
# tt = searchTwitter('SLP', n = 10000, since = '2021-01-01')
# SLP <- twListToDF(tt)
# write.csv(SLP,"SLP10000.csv", row.names = FALSE)Scraping tweets with “AXS”
AXS stands for the cryptocurrency ticker, this is used to trade the cryptocurrency AXS
Separate all the tweets into a list of words, gives 337,026 list of words
# tt = searchTwitter('AXS', n = 10000, since = '2021-01-01')
# AXS <- twListToDF(tt)
# write.csv(AXS,"AXS10000.csv", row.names = FALSE)Scraping tweets with “Sky Mavis”
Sky Mavis is the game creator/developer of Axie Infinity
Separate all the tweets into a list of words, gives 5,966 of words
# tt = searchTwitter('Sky Mavis', n = 10000, since = '2021-01-01')
# SkyMavis <- twListToDF(tt)
# write.csv(SkyMavis,"SkyMavis10000.csv", row.names = FALSE)Scraping tweets with “Scholarship”
In Axie Infinity the cost to play is a little high, ranging from $600 to $1,500 to start a team. So, players who become scholars, look for scholarships, which is a sponsorship for them to play, think of it as a free tuition fee to play.
Separate all the tweets into a list of words, gives 250,080 of words
# tt = searchTwitter('Scholarship', n = 10000, since = '2021-01-01')
# Scholarship <- twListToDF(tt)
# write.csv(Scholarship,"Scholarship10000.csv", row.names = FALSE)Scraping tweets with “Manager”
#In Axie Infinity the cost to play is a little high, ranging from $600 to $1,500 to start a team.The people who provide scholarships, are called the “Managers”, they shell out the initial capital.
Separate all the tweets into a list of words, gives 255,111 of words
# tt = searchTwitter('Manager', n = 10000, since = '2021-01-01')
# Manager <- twListToDF(tt)
# write.csv(Manager,"Manager10000.csv", row.names = FALSE)Scraping tweets with “Scholar”
#In Axie Infinity the cost to play is a little high, ranging from $600 to $1,500 to start a team. So players look to become scholars, and look for scholarships, in order to play the game
Separate all the tweets into a list of words, gives 217,195 of words
# tt = searchTwitter('Scholar', n = 10000, since = '2021-01-01')
# Scholar <- twListToDF(tt)
# write.csv(Scholar,"Scholar10000.csv", row.names = FALSE)Sentiments Analysis
Total Tweets Analyzed : 80,000 Tweets
Total Words Analyzed : 2,004,509 words
Sentiments in tweets with ‘Axie’
Axie = read.csv("Axie10000.csv")
tweet_words <- Axie %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'Axie'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘axie infinity’
axieinfinity = read.csv("axieinfinity10000.csv")
tweet_words <- axieinfinity %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'axie infinity'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘SLP’
SLP = read.csv("SLP10000.csv")
tweet_words <- SLP %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'SLP'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘AXS’
AXS = read.csv("AXS10000.csv")
tweet_words <- AXS %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'AXS'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘Axie’
SkyMavis = read.csv("SkyMavis10000.csv")
tweet_words <- SkyMavis %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'Sky Mavis'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘Scholarship’
Scholarship = read.csv("Scholarship10000.csv")
tweet_words <- Scholarship %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'Scholarship'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘Manager’
Manager = read.csv("Manager10000.csv")
tweet_words <- Manager %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'Manager'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Sentiments in tweets with ‘Scholar’
Scholar = read.csv("Scholar10000.csv")
tweet_words <- Scholar %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with 'Scholar'", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Pair Analysis
Axie and Scholar
Axie_Scholar = Axie[grepl("Scholar", Axie$text,ignore.case = TRUE),]
tweet_words <- Axie_Scholar %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with Axie and Scholar", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Axie and AXS
Axie_AXS = Axie[grepl("AXS", Axie$text,ignore.case = TRUE),]
tweet_words <- Axie_AXS %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with Axie and AXS", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Axie and SLP
Axie_SLP = Axie[grepl("SLP", Axie$text,ignore.case = TRUE),]
tweet_words <- Axie_SLP %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with Axie and SLP", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Axie and Sky Mavis
Axie_SkyMavis = Axie[grepl("Sky Mavis", Axie$text,ignore.case = TRUE),]
tweet_words <- Axie_SkyMavis %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with Axie and Sky Mavis", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Axie and Scholarship
Axie_Scholarship = Axie[grepl("Scholarship", Axie$text,ignore.case = TRUE),]
tweet_words <- Axie_Scholarship %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with Axie and Scholarship", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))Axie and Manager
Axie_Manager = Axie[grepl("Manager", Axie$text,ignore.case = TRUE),]
tweet_words <- Axie_Manager %>% select(id, text) %>% unnest_tokens(word,text)
my_stop_words <- stop_words %>% select(-lexicon)
tweet_words_interesting <- tweet_words %>% anti_join(my_stop_words)## Joining, by = "word"
bing_lex <- get_sentiments("nrc")
fn_sentiment <- tweet_words_interesting %>% left_join(bing_lex)## Joining, by = "word"
sentiments = fn_sentiment %>% filter(!is.na(sentiment)) %>% group_by(sentiment) %>% summarise(n=n())
sentiments = as.data.frame(sentiments)
sentiments$sentiment = as.factor(sentiments$sentiment)plot_ly(sentiments, x = ~sentiment,y =~n, type = "bar", color =~ sentiment )%>%
layout(title = "Sentiments in tweets with Axie and Manager", yaxis = list(title = "Word Count"), xaxis = list(title = "Sentiments", categoryorder = "total descending"))